//
//  SRPersonalServices.m
//  StoryShow
//
//  Created by CyonLeuMBP on 2017/3/31.
//  Copyright © 2017年 qudiandu.cn. All rights reserved.
//

#import "SRPersonalServices.h"
#import "SRMessageListModel.h"

@implementation SRPersonalServices
/*
 *  检查最新版本
 */
+ (void)queryLatestVersionSuccessBlock:(FZSuccessBlock)successBlock failureBlock:(FZFailureBlock)failureBlock {
    NSString *urlString = [[SRAPICreater sharedInstance] APIWithName:@"basic_getVersion"];
    SRNetWorkManager *manager = [SRNetWorkManager sharedInstance];
    
    [manager GET:urlString needCache:NO parameters:nil responseClass:nil success:successBlock failure:failureBlock];
}
/*
 *  查询消息列表
 */
+ (void)querySystemMessageListPage:(NSInteger)page successBlock:(FZSuccessBlock)successBlock failureBlock:(FZFailureBlock)failureBlock {
    NSString *urlString = [[SRAPICreater sharedInstance] APIWithName:@"basic_message"];
    SRNetWorkManager *manager = [SRNetWorkManager sharedInstance];
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params setValue:@(page) forKey:@"page"];
    [params setValue:@(10) forKey:@"rows"];
    
    [manager GET:urlString needCache:NO parameters:params responseClass:[SRMessageListModel class] success:successBlock failure:failureBlock];
}


/*
 *  发送用户反馈
 */
+ (void)sendFeedbackWithContent:(NSString *)content successBlock:(FZSuccessBlock)successBlock failureBlock:(FZFailureBlock)failureBlock {
    NSString *urlString = [[SRAPICreater sharedInstance] APIWithName:@"basic_feedback"];
    SRNetWorkManager *manager = [SRNetWorkManager sharedInstance];
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params setValue:content forKey:@"content"];
    
    
    [manager POST:urlString needCache:NO parameters:params responseClass:nil success:successBlock failure:failureBlock];
}


/*
 *  获取最新的广告信息
 */
+ (void)queryAdvertListSuccessBlock:(FZSuccessBlock)successBlock failureBlock:(FZFailureBlock)failureBlock {
    NSString *urlString = [[SRAPICreater sharedInstance] APIWithName:@"basic_advert"];
    SRNetWorkManager *manager = [SRNetWorkManager sharedInstance];
    
    [manager GET:urlString needCache:NO parameters:nil responseClass:nil success:successBlock failure:failureBlock];
}

/*
 *  修改用户信息
 */
+ (void)editUserInfo:(NSDictionary *)params successBlock:(FZSuccessBlock)successBlock failureBlock:(FZFailureBlock)failureBlock {
    NSString *urlString = [[SRAPICreater sharedInstance] APIWithName:@"user_editMember"];
    SRNetWorkManager *manager = [SRNetWorkManager sharedInstance];
    
    [manager POST:urlString needCache:NO parameters:params responseClass:nil success:successBlock failure:failureBlock];
}

@end
